import Vue from 'vue'
import Vuex from 'vuex'
Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    userInfo: {},
    webInfo: {},
    sortInfo: [],
    labelInfo: [],
    toolbar: {},
    routeList: []
  },
  getters: {

  },
  mutations: {
    userInfo(state, userInfo){
      state.userInfo = userInfo;
    },
    webInfo(state, webInfo){
      state.webInfo = webInfo;
    },
    sortInfo(state, sortInfo){
      state.sortInfo = sortInfo;
    },
    labelInfo(state, labelInfo) {
      state.labelInfo = labelInfo;
    },
    changeToolbarStatus(state, toolbarState) {
      state.toolbar = toolbarState;
    },
    customAddRoute(state, option) {
      state.routeList = option
    }
  },
  actions: {
    pushRoute({commit}, list) {
      commit('customAddRoute', list)
    }
  },
  modules: {},
  plugins: []
})
